#include<iostream>
#include<string>
using namespace std;
int a[5];
int main()
{
    string s;
    cin >> s;
    for (auto& ch : s)
    {
        if (ch == 'g' || ch == 'G') a[1]++;
        else if (ch == 'p' || ch == 'P') a[2]++;
        else if (ch == 'l' || ch == 'L') a[3]++;
        else if (ch == 't' || ch == 'T') a[4]++;
    }
    string tmp;
    int m = 0;
    for (int i = 1; i <= 4; i++) m = max(m, a[i]);
    for (int i = 1; i <= m; i++)
    {
        if(a[1]) tmp += 'G', a[1]--;
        if(a[2]) tmp += 'P', a[2]--;
        if(a[3]) tmp += 'L', a[3]--;
        if(a[4]) tmp += 'T', a[4]--;
    }
    cout << tmp << endl;
    return 0;
}